function drawAttenPass(filter, hP, freqUnits)
   
    if strcmp(freqUnits, 'rad/s')
        Fp = filter.Fp * 2 * pi;
        Fa = filter.Fa * 2 * pi;
    else
        Fp = filter.Fp;
        Fa = filter.Fa;
    end
    Ap = filter.Ap;
    Aa = filter.Aa;
    G = -filter.gain;
    
    hold(hP, 'off')
    line([0.001 10000000], [G G], 'Parent', hP, 'Color', [0 0 0]);
    hold(hP, 'on')

    switch filter.filterType
        case 'Lowpass'
            x1 = [0.001, Fp];
            y1 = [Ap+G, Ap+G];
            x2 = [Fp, Fp];
            y2 = [Ap+G, 1000+G];
            x3 = [Fa, 10000000];
            y3 = [Aa+G, Aa+G];
            x4 = [Fa, Fa];
            y4 = [0+G, Aa+G];
        case 'Highpass'
            x1 = [0.001, Fa];
            y1 = [Aa+G, Aa+G];
            x2 = [Fa, Fa];
            y2 = [0+G, Aa+G];
            x3 = [Fp, 10000000];
            y3 = [Ap+G, Ap+G];
            x4 = [Fp, Fp];
            y4 = [Ap+G, 1000+G];
        case 'Bandpass'
            x1 = [0.001, Fa(1)];
            y1 = [Aa+G, Aa+G];
            x2 = [Fa(1), Fa(1)];
            y2 = [0+G, Aa+G];
            x3 = [Fp(1), Fp(1)];
            y3 = [Ap+G, 1000+G];
            x4 = [Fp(1), Fp(2)];
            y4 = [Ap+G, Ap+G];
            x5 = [Fp(2), Fp(2)];
            y5 = [Ap+G, 1000+G];
            x6 = [Fa(2), Fa(2)];
            y6 = [0+G, Aa+G];
            x7 = [Fa(2), 10000000];
            y7 = [Aa+G, Aa+G];
            line(x5, y5, 'Parent', hP, 'Color', [0 0 0]);
            line(x6, y6, 'Parent', hP, 'Color', [0 0 0]);
            line(x7, y7, 'Parent', hP, 'Color', [0 0 0]);
        case 'Stopband'
            x1 = [0.001, Fp(1)];
            y1 = [Ap+G, Ap+G];
            x2 = [Fp(1), Fp(1)];
            y2 = [Ap+G, 1000+G];
            x3 = [Fa(1), Fa(1)];
            y3 = [0+G, Aa+G];
            x4 = [Fa(1), Fa(2)];
            y4 = [Aa+G, Aa+G];
            x5 = [Fa(2), Fa(2)];
            y5 = [0+G, Aa+G];
            x6 = [Fp(2), Fp(2)];
            y6 = [Ap+G, 1000+G];
            x7 = [Fp(2), 10000000];
            y7 = [Ap+G, Ap+G];
            line(x5, y5, 'Parent', hP, 'Color', [0 0 0]);
            line(x6, y6, 'Parent', hP, 'Color', [0 0 0]);
            line(x7, y7, 'Parent', hP, 'Color', [0 0 0]);
    end
    if ~strcmp(filter.filterType, 'Group-Delay')
        line(x1, y1, 'Parent', hP, 'Color', [0 0 0]);
        line(x2, y2, 'Parent', hP, 'Color', [0 0 0]);
        line(x3, y3, 'Parent', hP, 'Color', [0 0 0]);
        line(x4, y4, 'Parent', hP, 'Color', [0 0 0]);
        % rectangle('Parent', hP, 'Position',[1,Ap,Fp,1000],'Curvature',[0,0], 'FaceColor','r', 'Clipping', 'on')
    end    
end